package com.zkthink.ceres.member.dao;

import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.member.entity.XsyMemberExchange;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 会员变化历史
 * </p>
 *
 * @author ck
 * @date 2021-11-26
 */
@Repository
public interface XsyMemberExchangeMapper extends SuperMapper<XsyMemberExchange> {

    /**
     * 如果某个客户类型发生过变化，找到距离日期busiDate最近的那条数据。
     *
     * @param busiDate
     * @param exchanegType
     * @return
     */
    public XsyMemberExchange getMinByExchangeAndBusiDate(@Param("mid") Long mid, @Param("busiDate") String busiDate, @Param("exchanegType") Integer exchanegType);

    public List<XsyMemberExchange> getMinByOldExchange(@Param("mid") Long mid, @Param("oldVip") Integer oldVip);

}
